<?php

/**
 * Service form.
 *
 * @package    cadsurvey
 * @subpackage form
 * @author     sharavdorj
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class ServiceForm extends BaseServiceForm
{
  public function configure() {
  	unset($this['created_at'],$this['updated_at']);
  	$this->embedI18n(array('mn', 'en'));
    $this->widgetSchema->setLabel('en', 'English');
    $this->widgetSchema->setLabel('mn', 'Mongolian');
	$this->widgetSchema['image'] = new sfWidgetFormInputFileEditable(array(
							'file_src'     => '/uploads/service'.'/'.$this->getObject()->getImage(),
                            'is_image'     => true,
                            'with_delete'  => !is_null($this->getObject()->getImage()),
							'edit_mode'=>!$this->isNew()),
                            array('height'	   => '200px'));
	$this->setValidator('image', new sfValidatorFile(array(
                             'mime_types'  => 'web_images',
                             'path'        => sfConfig::get('sf_upload_dir').'/service',
                             'required' 		=> false,
                                                   )));						   
  }
}
